let getQueryString = function(name) {
	var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
	var r = window.location.search.substr(1).match(reg);
	if(r != null) {
		return unescape(r[2]);
	}
	return null;
};
const vm = new Vue({
	el: "body>article",
	data: {
		vo: {}
	},
	methods: {
		update: function() {
			console.log(getQueryString('id'));
			axios.put(`/relative/${getQueryString('id')}`,this.vo).then(function(resp) {
				if(resp.code === "ok") {
					toast("ok");
					
				} else {
					toast(resp.message);
				}
			})
		}
	},
	created:function(){
		axios.get(`/relative/${getQueryString('id')}`).then(function(resp){
			if(resp.code==="ok"){
				vm.vo=resp.data;
				
			}else{
				toast(resp.message);
			}
		});
	}
})